#pragma once

namespace luster {

#define STATUS_MAP(_) \
	_(OK) \
	_(ERROR) \
	_(EOF) \
	_(LIST_CLOSE) \
	_(STRING_CLOSE) \
	_(NO_KEYWORD) \
	_(LEADING_CHAR) \
	_(ARGS_COUNT_ERR) \
	_(TYPE_ERROR)

enum Status {
#define _(M_NAME) STATUS_##M_NAME,
	STATUS_MAP(_)
#undef _
};

#define luster_TRY(M_expr) \
	do { \
		Status status__ = (M_expr); \
		if (status__ == STATUS_OK) { \
			break; \
		} \
		return status__; \
	} while (0)

char const *status_description(Status status);

#define luster_UNUSED(M_x) ((void)M_x##__)

} // namespace luster
